<?php

namespace app\admin\controller;

use think\Controller;

class Goodsdemand extends Controller
{
    public function index(){
		$demand = db('demand')->where('status',0)->paginate();
		$this->assign('list',$demand);
		return $this->fetch();
	}
	
	/* 删除 */
	public function delete(){
		$demand_id = request()->param('id');
		
		!$demand_id && $this->error('参数错误');
		
		$res = db('demand')->delete($demand_id);
		if($res !== false){
			$this->success('删除成功');
		}else{
			$this->error('删除失败');
		}
	}
}